package com.bawei.yangzongcai___day2.MaiDongFangHong.day8;

import com.bawei.mmvvpp.mm.KotlinModelAcyivity;
import com.bawei.yangzongcai___day2.MVCAcyivity.HttpLogingtion;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * create by ertu
 * create on 2021/7/31
 * description
 */
public class KotlindayModel extends KotlinModelAcyivity implements KotlinContion.kotlincontionModel {


    @Override
    public void getkotlinmodel(final KotlinCallbck kotlinCallbck) {
        KotlinHttp.getkotlinhttp().retrofit(" https://gank.io/api/v2/data/category/Girl/type/Girl/").create(Kotlinapl8.class).getJavaday8()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.computation())
                .subscribe(new Observer<Javaday8>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(Javaday8 javaday8) {
                        List<Javaday8.DataBean> dataBeans = javaday8.getData();
                        kotlinCallbck.kotlinsueess(dataBeans);

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }


}
